/**
 * Created by isc05210 on 28-2-14.
 */

//make console if not present

if (window.console === undefined) {
    window.console = {};
    window.console.text = "";
    window.console.log = function(s){console.text+=(s+"\n");};
}

//make typeOf function if not present
if (window.typeOf ===undefined){
    window.typeOf = function (obj) {
       return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
    };
}

//make JSON oobject if not present
if (window.JSON === undefined) {
    window.JSON = {};

    window.JSON.stringify = function(obj){
        return  result = "JSON.stringify" + obj;
        /*
        for (item in obj){
            if (typeOf(item)==="string"){
                result+=item;
                //result+=(typeOf(item)==="string")?item: indow.JSON.stringify(item);
            }
        }
        */
        //return result;
    }
}